import type { App } from 'vue'

// 组件导入
import DataConfig from './DataConfig/index.vue'
import DutySelect from './DutySelect/index.vue'
import FaceManage from './FaceManage/index.vue'
import FormDialog from './FormDialog/index.vue'
import ImportDialog from './ImportDialog/index.vue'
import JsonEditor from './JsonEditor/index.vue'
import Map from './Map/index.vue'
import MeetingRoomSelection from './MeetingRoomSelection/index.vue'
import MonthScheduleView from './MonthScheduleView/index.vue'
import MyAmountInput from './MyAmountInput/index.vue'
import MyFileUpload from './MyFileUpload/index.vue'
import MyImgPreview from './MyImgPreview/index.vue'
import MyPdfUpload from './MyPdfUpload/index.vue'
import QueryFormComponent from './QueryForm/index.vue'
import RouterLink from './RouterLink/index.vue'
import QsTable from './Table/index.vue'
import Tags from './Tags/index.vue'
import TreeSelect from './TreeSelect/index.vue'

// Qvil 组件导入
import DetailDialogQvil from './DetailDialogQvil/index.vue'
import FormDialogQvil from './FormDialogQvil/index.vue'
import ImportDialogQvil from './ImportDialogQvil/index.vue'
import SearchFormQvil from './SearchFormQvil/index.vue'
import TableQvil from './TableQvil/index.vue'

// 组件列表
const components = {
  // 基础组件
  Map,
  Tags,
  JsonEditor,
  TreeSelect,
  DutySelect,
  MyImgPreview,
  MyAmountInput,
  MyFileUpload,
  MyPdfUpload,
  RouterLink,
  ImportDialog,

  // 业务组件
  FaceManage,
  MonthScheduleView,

  // 表单相关组件
  QsTable,
  QueryFormComponent,
  FormDialog,

  // 新增组件
  MeetingRoomSelection,

  // Qvil 组件
  DetailDialogQvil,
  FormDialogQvil,
  ImportDialogQvil,
  SearchFormQvil,
  TableQvil,
}

// 组件注册
export function setupMyComponents(app: App<Element>) {
  // 注册所有组件
  Object.entries(components).forEach(([name, component]) => {
    app.component(name, component)
  })
  app.component('DataConfig', DataConfig)
}

// 组件导出
export { default as DutySelect } from './DutySelect/index.vue'
export { default as FaceManage } from './FaceManage/index.vue'
export { default as FormDialog } from './FormDialog/index.vue'
export { default as ImportDialog } from './ImportDialog/index.vue'
export { default as JsonEditor } from './JsonEditor/index.vue'
export { default as Map } from './Map/index.vue'
export { default as MeetingRoomSelection } from './MeetingRoomSelection/index.vue'
export { default as MonthScheduleView } from './MonthScheduleView/index.vue'
export { default as MyAmountInput } from './MyAmountInput/index.vue'
export { default as MyFileUpload } from './MyFileUpload/index.vue'
export { default as MyImgPreview } from './MyImgPreview/index.vue'
export { default as MyPdfUpload } from './MyPdfUpload/index.vue'
export { default as QueryFormComponent } from './QueryForm/index.vue'
export { default as RouterLink } from './RouterLink/index.vue'
export { default as QsTable } from './Table/index.vue'
export { default as Tags } from './Tags/index.vue'
export { default as TreeSelect } from './TreeSelect/index.vue'

// Qvil 组件导出
export { default as DetailDialogQvil } from './DetailDialogQvil/index.vue'
export { default as FormDialogQvil } from './FormDialogQvil/index.vue'
export { default as ImportDialogQvil } from './ImportDialogQvil/index.vue'
export { default as SearchFormQvil } from './SearchFormQvil/index.vue'
export { default as TableQvil } from './TableQvil/index.vue'
